using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using UnityEngine;

public class BCWUtils
{
	public static IEnumerator WaitForRealSeconds(float delay)
	{
		float start = Time.realtimeSinceStartup;
		while (Time.realtimeSinceStartup < start + delay)
		{
			yield return null;
		}
	}

	public static void BubbleSort<T>(List<T> list, Comparison<T> comp)
	{
		T val = default(T);
		for (int i = 0; i < list.Count; i++)
		{
			for (int j = 0; j < list.Count - 1; j++)
			{
				if (comp(list[j], list[j + 1]) == 1)
				{
					val = list[j + 1];
					list[j + 1] = list[j];
					list[j] = val;
				}
			}
		}
	}

	public static string ConvertFromBase64(string s)
	{
		byte[] array = Convert.FromBase64String(s);
		return Encoding.UTF8.GetString(array, 0, array.Length);
	}

	public static string ConvertToBase64(string s)
	{
		return Convert.ToBase64String(Encoding.UTF8.GetBytes(s));
	}
}
